
PREFIX := aarch64-linux-gnu-

CC := $(PREFIX)gcc
LD := $(PREFIX)ld
OBJDUMP := $(PREFIX)objdump

FVP_RUN := timeout 1s fvp_aem_run 

switch_el: switch_el.o out_p.o
	$(LD) -T$@.lds $^ -o $@.elf
	$(OBJDUMP) -d $@.elf > $@.asm
	$(FVP_RUN) $@.elf

el_status: el_status.o
	$(LD) -T$@.lds $^ -o $@.elf
	$(OBJDUMP) -d $@.elf > $@.asm
	$(FVP_RUN) $@.elf

clean:
	touch *.{o,elf}
	rm *.{o,elf}

%.o: %.S
	$(CC) -c $^ -o $@